<template>
	<view>
		<cu-custom :isBack="true" bgColor="bg-gradual-fff">
			<block slot="content">测评结果</block>
		</cu-custom>
		<u-loading-page :loading="true" loading-text="loading..." v-if="showLoading"></u-loading-page>
		<view v-show="!showLoading">
			<view class="viewbox"></view>
			<view class="group1">
				<view class="p">
					<view class="text1">财富密码</view>
				</view>
				<view class="content">
					<view class="line">
						<text>你是{{wealthCodeContent.mean}}，</text>
						<text>{{wealthCodeContent.content}}</text>
					</view>
					<view class="sub-title">赚钱秘籍</view>
					<view v-for="(item,index) in makeMoneyContent.content" :key="index" class="line">
						<text>{{item}}</text>
					</view>
				</view>
			</view>
			<!-- <view class="group2">
				<navigator url="/pages/test_center/evaluate"><button class="btn">写评价</button></navigator>
			</view> -->
		</view>	
	</view>
</template>
<script>
	import request from '@/common/request.js';
	import {
		getPrimaryCodeContent
	} from '@/utils/primaryCode.js'
	import {
		getWealthCodeContent,
		getMakeMoneyContent
	} from '@/utils/wealthCode.js'
	
	export default {
		data() {
			return {
				showLoading:true,
				params: {},
				primaryCodeContent: {},
				makeMoneyContent: {
					content: []
				},
				wealthCodeContent: {
					mean: '',
					content: ''
				},
				starContent: [],
				internalExternalCodeContent: [],
				unionCodesContent: [],
				order_sn:'',
				uid:0
			}
		},
		onLoad: function(options) { //option为object类型，会序列化上个页面传递的参数
			this.order_sn=options.order_sn??'';
			this.uid=uni.getStorageSync('uid');
			this.getOrderDetailFun()
		},
		methods: {
			getOrderDetailFun(){
				let paramsList = {
					uid:this.uid,
					order_sn:this.order_sn
				}
				let optsList = {
					url: 'o-testdetail',
					method: 'post'
				};
				let _this=this;
				request.httpTokenRequest(optsList, paramsList).then(res => {
					if(res.data.code == 200){
						_this.orderDetail=res.data.data;
						_this.info=_this.orderDetail.info;
						const selfBirthday = _this.info.selfBirthday
						if (!selfBirthday) {
							return
						}
						_this.wealthCodeContent = getWealthCodeContent(selfBirthday)
						_this.makeMoneyContent = getMakeMoneyContent(selfBirthday)
					}else{
						setTimeout(() => uni.navigateBack(), 1500);
						return;
					}
					_this.showLoading=false;
				});
			}
		}
	}
</script>

<style  lang="scss" scoped>
	.group1{
		margin: auto;
		margin-top: 60rpx;
		width: 700rpx;
		height: auto;
		border-radius: 20rpx;
		box-shadow: inset 0 0 20rpx 20rpx rgba(85, 56, 105, 1);
		padding: 40rpx;
	}
	.p{
		overflow: hidden;
	}
	.text1{
		// position: absolute;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #FFFFFF;
		line-height: 120rpx;
	}
	.content{
		width:100%;
		height: auto;
		font-family: PingFang SC;
		font-weight: 500;
		font-size: 26rpx;
		color: #FFFFFF;
		line-height: 48rpx;
	}
	.group2{
		width: 750rpx;
		height: 120rpx;
		background: #FFFFFF;
		border-radius: 10rpx 10rpx 0rpx 0rpx;
		border: 1px solid #F2F2F2;
		position: fixed;
		bottom: 0rpx;
	}
	.btn{
		margin-top: 16rpx;
		width: 330rpx;
		height: 88rpx;
		background: #62469B;
		border-radius: 44rpx;
		

		font-family: PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #FFFFFF;
		line-height: 90rpx;
	}
</style>
